<?php
class widget extends control {
	
	public function display()
	{
		$backtrace = debug_backtrace();
		$widgetName = $backtrace[1]['function'];
		$viewFile = "../widget/{$this->widgetName}/view/{$widgetName}.html.php";
		if ( ! file_exists( $viewFile ) ) trigger_error( "widget 视图文件 $viewFile 不存在" );
		extract( (array)$this->view );
		ob_start();
		require $viewFile;
		$res = ob_get_contents();
		ob_end_clean();
		return $res;
	}
}
